<template>
  <div class="register-button flex flex-col">
    <el-button
      class="linear-gradient-button bottom-button"
      :loading="props.loading"
      size="large"
      style="width: 100%"
      @click.prevent="emit('submit')"
    >
      <span v-if="!loading">提交注册</span>
      <span v-else>提交申请中...</span>
    </el-button>
    <div class="flex justify-end mt-1">
      <el-link :underline="false">已有账号？</el-link>
      <el-link class="ml-1" type="primary" :underline="false" @click="emit('register')">
        立即登录
      </el-link>
    </div>
  </div>
</template>
<script setup>
const emit = defineEmits(["submit", "register"]);
const props = defineProps({
  loading: {
    type: Boolean,
    default: false,
  },
});
</script>
<style scoped lang="scss">
.bottom-button {
  width: 100% !important;
  margin: 0 auto !important;
}
</style>
